#pragma once

#include "CMObject.h"

class CMException : public ::System::CMObject {
public:

  CMException& operator=(const CMException &r)                
  {                                      
    ::System::CMObject::operator=(r);                      
    return *this;                            
  }                                      

  WREXPORT static CMException DynamicCast(const ::System::CMObject& object);

#ifdef _MANAGED
  CMException(::System::Exception^ o) : ::System::CMObject(o) 
  { 
    message=o->Message;
    stackTrace=o->StackTrace;
    source = o->Source;
  }                    
  ::System::Exception^ ThisObject() const                        
  {                                      
    return static_cast<::System::Exception^>((Object^)m_handle);        
  }                                      
  ::System::Exception^ operator->() const                        
  {                                      
    return ThisObject();                        
  }
  CMException& operator=(::System::Exception^ o)
  {
    m_handle = o;                            
    return *this;                            
  }
#endif
private:
  CString message;
  CString stackTrace;
  CString source;
public:
	WREXPORT CString HelpLink() const;
	WREXPORT CString Message() const;
	WREXPORT CString Source() const;
	WREXPORT CString StackTrace() const;
	WREXPORT CMException InnerException() const;
};